Bug 573383 – GtkMountOperation fixes for ask_password()
authorDavid Zeuthen <davidz@redhat.com>
Fri, 27 Feb 2009 21:03:47 +0000 (21:03 +0000)
committerDavid Zeuthen <davidz@src.gnome.org>
Fri, 27 Feb 2009 21:03:47 +0000 (21:03 +0000)
2009-02-27  David Zeuthen  <davidz@redhat.com>

Bug 573383 – GtkMountOperation fixes for ask_password()

* gtk/gtkmountoperation.c (gtk_mount_operation_ask_password):
Split the message from GMountOperation into primary/secondary like
we also do in gtk_mount_operation_ask_question()

svn path=/trunk/; revision=22415

ChangeLog
gtk/gtkmountoperation.c

index 21233cc117ff81b7ee5c656a437787ff64bfd75d..959bb93e17f77e344fdd5a0eb9758381aae90af5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-02-27  David Zeuthen  <davidz@redhat.com>
+
+       Bug 573383 – GtkMountOperation fixes for ask_password()
+
+       * gtk/gtkmountoperation.c (gtk_mount_operation_ask_password):
+       Split the message from GMountOperation into primary/secondary like
+       we also do in gtk_mount_operation_ask_question()
+
 2009-02-27  Michael Natterer  <mitch@imendio.com>
 
        Bug 573383 – Setting a textview's buffer to NULL doesn't do a
index b4802edd846ce5669447b8c1adecb8707f2ebb57..66563eeec57cb1a0d92c9b2d46a069bd762c8fb2 100644 (file)
@@ -434,6 +434,7 @@ gtk_mount_operation_ask_password (GMountOperation   *mount_op,
   GtkWidget *message_label;
   gboolean   can_anonymous;
   guint      rows;
+  const gchar *secondary;
 
   operation = GTK_MOUNT_OPERATION (mount_op);
   priv = operation->priv;
@@ -482,11 +483,33 @@ gtk_mount_operation_ask_password (GMountOperation   *mount_op,
   main_vbox = gtk_vbox_new (FALSE, 18);
   gtk_box_pack_start (GTK_BOX (hbox), main_vbox, TRUE, TRUE, 0);
 
-  message_label = gtk_label_new (message);
-  gtk_misc_set_alignment (GTK_MISC (message_label), 0.0, 0.5);
-  gtk_label_set_line_wrap (GTK_LABEL (message_label), TRUE);
-  gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (message_label),
-                      FALSE, FALSE, 0);
+  secondary = strstr (message, "\n");
+  if (secondary != NULL)
+    {
+      gchar *s;
+      gchar *primary;
+
+      primary = g_strndup (message, secondary - message + 1);
+      s = g_strdup_printf ("<big><b>%s</b></big>%s", primary, secondary);
+
+      message_label = gtk_label_new (NULL);
+      gtk_label_set_markup (GTK_LABEL (message_label), s);
+      gtk_misc_set_alignment (GTK_MISC (message_label), 0.0, 0.5);
+      gtk_label_set_line_wrap (GTK_LABEL (message_label), TRUE);
+      gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (message_label),
+                          FALSE, TRUE, 0);
+
+      g_free (s);
+      g_free (primary);
+    }
+  else
+    {
+      message_label = gtk_label_new (message);
+      gtk_misc_set_alignment (GTK_MISC (message_label), 0.0, 0.5);
+      gtk_label_set_line_wrap (GTK_LABEL (message_label), TRUE);
+      gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (message_label),
+                          FALSE, FALSE, 0);
+    }
 
   vbox = gtk_vbox_new (FALSE, 6);
   gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);